<?php
//20110707
require_once 'Shared/Models/Scontent.php';
require_once 'Shared/Models/ScontentLang.php';
require_once 'Shared/Models/ScontentCategory.php';
//20110707
class main_menuSticker extends Vi_Sticker
{
	public function run()
	{
		//20110707
		$portalAlias = Vi_Registry::getAppName();
		//20110707
		$menus = array(
        	0 => array(
                    //'url' => Vi_Registry::getBaseUrl().'gosac',
                    'url' => Vi_Registry::getBaseUrl(). $portalAlias, //20110707
                    'name' => 'Home',
                    'id' => 'home'
                    ),
            1 => array(
                     'url' => Vi_Registry::getContentUrl(24),
                    'name' => 'Search',
                    'id' => 1
                    ),
            2 => array(
                    'url' => Vi_Registry::getContentUrl(25),
                    'name' => 'Post a Vacancy',
                    'id' => 2
                    ),
            3 => array(
                    'url' => Vi_Registry::getContentUrl(26),
                    'name' => 'Pay Rent Online',
                    'id' => 3
                    ),
            4 => array(
                    'url' => Vi_Registry::getContentUrl(27),
                    'name' => 'Landlords/Owners',
                    'id' => 4
                    ),
            5 => array(
                    'url' => Vi_Registry::getContentUrl(28),
                    'name' => 'Moving Quotes',
                    'id' => 5
                    ),
        );
        $this->view->menus = $menus;
        //20110707
        
        $objPortal = new Models_Portal();
        $portal = $objPortal->getPortalbyAlias($portalAlias);
        $portal = current($portal);
        $this->view->portalId = $portal['portal_id'];
        $objScontent = new Models_Scontent();
        $scontent = $objScontent->getAllContentsWithLang();
        foreach($scontent as &$item)
        	$item['url'] = Vi_Registry::getAppBaseUrl(). 'page/' . $item['url'] . '.html';
        $this->view->scontent = $scontent;
        $this->view->scontentSubMenu = $scontent; //20110711
        unset($item);
//        echo '<pre>'; print_r($scontent);die;
		$this->view->menuId = 2;//main menu
		$this->view->subMenuId = 3; //sub main menu //20110711
		$this->view->homeUrl = $menus[0][url];
		$this->view->homeName = $menus[0][name];
        //20110707
	}
}